-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 3.1 style for configuration tool #5108
Windows 3.1 style for configuration tool #5108
Conversation
As explained, this will need more work, not sure how these as there's no way as far as I know on checking whether an iterator is null or not.
By the way, not sure about that one nor when it started to happen: |
Either the configuration menu should enforce a minimum of 800x600, or perhaps all the buttons could be placed inside a scrollable region. |
1st thing I guess would be to remove the header "Choose a settings...", it takes place and is useless. Then to see where the checkbox could go, maybe it can work in menu or in other windows. If so, then we gain 1 line immediately. Also maybe, window can become 720 px wide with maybe slightly smaller labels, e.g. IDE #1, LPT, COM. If all these work we might be able to have 5 columns and would gain lot of space for eventual future sections. |
Problem is, if below 26 then focus while pressed is cropped... And if you adjust label positions it looks really squished. Then you have margins between buttons that must be kept else it looks horrible. Noticed that, not sure why on default config with TTF save/close are not cropped: |
Hmm, so it's kind of complicated. |
It fits EXACTLY, there's zero pixel room at bottom.
Before: After: Before: After: Summary:
I think that's enough for the PR... Reference for future improvements:
|
Final version: Fixed layout, sorted help/properties, revamped main window/labels. Mouse wheel does not work, it needs window to be clicked at least once for it to work, not sure why: Dark theme: Not for now, not easy at all to come up with the right colors... Full Windows 3.1 theme: Not for now, I did however extract all themes from CONTROL.INI, will need quite some refactoring. Beside mouse wheel issue, things look good, I guess it's enough for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test builds are built successfully with the fixes.
@@ -2272,25 +2333,27 @@ bool ScreenSDL::event(SDL_Event &event) { | |||
} | |||
lastdown = 0; | |||
return rc; | |||
} | |||
case SDL_MOUSEWHEEL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDL_MOUSEWHEEL not available on SDL1?
Maybe add #if defined(C_SDL2)
gui_tk.cpp:2336:10: error: use of undeclared identifier 'SDL_MOUSEWHEEL'
case SDL_MOUSEWHEEL:
^
gui_tk.cpp:2337:33: error: no member named 'wheel' in 'SDL_Event'
return mouseWheel(event.wheel.y);
src/libs/gui_tk/gui_tk.cpp
Outdated
bool WindowInWindow::mouseWheel(int wheel) | ||
{ | ||
// BUG requires to click at least once in window for it to work | ||
scroll_pos_y = min(max(scroll_pos_y - wheel * 15, 0), scroll_pos_h); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add #include <algorithm>
header, and use std::min, std::max instead?
gui_tk.cpp:2880:20: error: use of undeclared identifier 'min'; did you mean 'fmin'?
scroll_pos_y = min(max(scroll_pos_y - wheel * 15, 0), scroll_pos_h);
^~~
fmin
Ready? |
Thank you for the fix. I'm happy that the cropped window is fixed as well as the improved look & feel. |
Nice! Just two things I'm not happy with: This is really a dirty fix I did by just swapping the operands, it happens during ENC obviously so I am wondering whether it's simply due to it or not, searched online but didn't find much about it: Seems like the GUI would need good refactoring to implement mouse wheel without clicking it first, correct? (btw, just noticed that one can flick scroll, obviously, it's been clicked at this point so that doesn't help much) |
Does this PR introduce new feature(s)?
Trying to apply pixel-perfect Windows 3.11 look'n'feel to CFGTOOL...
Buttons are up as well as their focus style.
Ideally,
Before:
After: